var statistic = {

    assignAjaxRequestToGetExpenseList: function ($anchor) {
        var anchorId = $anchor.attr('id'), anchorIdArr, categoryId, $catBox;
        anchorIdArr  = anchorId.split("-")
        categoryId   = anchorIdArr[1];

        $('.category-expenses-box').hide();
        $catBox = $('#category-expenses-' + categoryId);
        if ($catBox[0] != undefined) {
            $catBox.show();
            return true;
        }

        $.ajax({
            url: $anchor.attr('href'),
            type: 'POST',
            data: {
                categoryId: categoryId,
                year: $('#filter_statistic_year').val(),
                months: $('#filter_statistic_month').val()
            },
            success: function (result) {
                $(result).appendTo($('#statistic-expense-list'));
            }
        });

    }
}